Hi all, Problem with OLE Argument names
string selectFile(bool saveFile)
{
string dbMethod;
string initDir = "C:/";
int flags;
int intAns;
string retV;
if (saveFile)
{
dbMethod = "ShowSave";
flags = 0x80000 | 0x00002;
}
else
{
dbMethod = "ShowOpen";
flags = 0x80000 | 0x01000 | 0x00800;
}
OleAutoObj objCD = oleCreateAutoObject("userAccounts.CommonDialog");
retV = olePut(objCD, "filter", "Session files|*.*");
if (retV != "") { infoBox("Set filter failed"); return (""); }
retV = olePut(objCD, "InitialDir", initDir);
if (retV != "") { infoBox("Set Init dir failed"); return (""); }
retV = olePut(objCD, "Flags", flags);
if (retV != "") { infoBox("Set flags failed"); return (""); }
// Here comes the problem...
retV = oleMethod (objCD, dbMethod, null, intAns);
if (retV != "") { infoBox(dbMethod " failed: " retV); return (""); }
if (intAns == 1)
{
retV = oleGet(objCD, "Filename", retV);
if (retV != "") { infoBox("oleGet failed"); return (""); }
return (retV);
}
return ("");
}
SystemAdmin - Wed Mar 20 06:15:17 EDT 2013 |
Re: OLE ShowSave method of CommonDialog not working Update: the code
retV = oleGet(objCD, "Filename", retV);
if (retV != "") { infoBox("oleGet failed"); return (""); }
return (retV);
string fName;
retV = oleGet(objCD, "Filename", fName);
if (retV != "") { infoBox("oleGet failed"); return (""); }
return (fName);
|
Re: OLE ShowSave method of CommonDialog not working
Hi retV = oleMethod (objCD, dbMethod, null, intAns);
retV = oleMethod (objCD, dbMethod, intAns);
|
Re: OLE ShowSave method of CommonDialog not working SystemAdmin - Wed Mar 20 14:36:37 EDT 2013
Hi retV = oleMethod (objCD, dbMethod, null, intAns);
retV = oleMethod (objCD, dbMethod, intAns);
Thanks for the answer. I tried your suggestion, but I get the error -E- DXL: <addins/MyDOORS/Myfunc.dxl:62> incorrect arguments for function (oleMethod) It seems that the oleMethod needs exactly 4 arguments... Also, the same function runs correctly when the method name is "ShowOpen", even if the 3rd argument is null... N. |
Re: OLE ShowSave method of CommonDialog not working SystemAdmin - Thu Mar 21 13:08:33 EDT 2013
Hello
OleAutoObj objCD = oleCreateAutoObject("userAccounts.CommonDialog");
|